﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;


public partial class user_Default : Wozuji.Logic.PageLogin
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Page.Header.Title = "足迹网用户首页";
        try
        {
            
            
                Wozuji.Model.Member_t mb = new Wozuji.Model.Member_t();
                Wozuji.DAL.Member_t mbdal = new Wozuji.DAL.Member_t();
                mb = mbdal.GetModel_ByMemberId(Convert.ToInt32(Session["userid"]));

                face.ImageUrl = "/user/UserHeadImage/" + mb.Member_Face.ToString();

                //Master.lname.Text = mb.Member_Name;
                m_show.Text = mb.Member_sign;
                username.Text = mb.Member_Name;
                username.NavigateUrl = "/user/setprofile.aspx?uid=" + mb.Member_Id.ToString();
                if (mb.Member_Sex.Equals("1"))
                {
                    sex.Text = "男";
                }
                else if (mb.Member_Sex.Equals("0"))
                {
                    sex.Text = "女";
                }
                else
                {
                    sex.Text = "保密或未设置";
                }
                birthday.Text = mb.Member_birthday.ToString().Replace("0:00:00","");

                
            }
            
            

        
        catch(Exception ex) { 
            
        }
        
    }
    
    
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (m_show_detail.Text.Equals("") || m_show_detail.Text.Equals("你在做什么?你在想什么?"))
        {
            m_show_detail.Text = "提示：请输入内容";
        }
        else {
            Button1.Text = "提交中";
            //写入数据库
            Wozuji.Model.Member_t mb = new Wozuji.Model.Member_t();
            Wozuji.BLL.Member_t mbbll = new Wozuji.BLL.Member_t();
            mb = mbbll.GetModel(Convert.ToInt32(Session["userid"].ToString()));
            mb.Member_sign = m_show_detail.Text.ToString();
            mbbll.Update(mb);
            mb = null;
            mbbll = null;
            m_show.Text = m_show_detail.Text;

            //写入成功,恢复初始
            m_show_detail.Text = "你在做什么?你在想什么?";
            Button1.Text = "闪一下";
        }
    }
    protected void m_show_detail_TextChanged(object sender, EventArgs e)
    {

    }
}
